<template>
  <el-drawer v-model="drawer" title="各阶段项目统计" :with-header="true">
    <el-table :data="projectTab">
      <el-table-column property="stateName" label="阶段名称" />
      <el-table-column property="count" label="项目数" />
      <el-table-column property="price" label="总金额(元)">
        <template #default="scope">
          <div>
            {{ numberFormat(scope.row.price) }}
          </div>
        </template>
      </el-table-column>
    </el-table>
  </el-drawer>
</template>

<script lang="ts" setup>
  import { ref } from 'vue'
  import { numberFormat } from '@/utils/numberFormat.ts'
  const drawer = ref(false)
  const projectTab = ref([])
  const show = (data) => {
    projectTab.value = data
    drawer.value = true
  }
  defineExpose({
    show,
  })
</script>

<style></style>
